Add OstreeAsyncProgress, use it for ostree_repo_pull
authorColin Walters <walters@verbum.org>
Thu, 24 Oct 2013 13:10:34 +0000 (09:10 -0400)
committerColin Walters <walters@verbum.org>
Thu, 24 Oct 2013 18:27:13 +0000 (14:27 -0400)
commitc65923e64241ddeffbbfe48555150fd4d0ec1a8c
treea0cd27dc6a577be18030dc222b9d17f9ab25e97b
parent9aaa29598eb7d54575d5012418fd3f604866d460
Add OstreeAsyncProgress, use it for ostree_repo_pull

Several APIs in libostree were moved there from the commandline code,
and have hardcoded g_print() for progress and notifications.  This
isn't useful for people who want to write PackageKit backends, custom
GUIs and the like.

From what I can tell, there isn't really a winning precedent in GLib
for progress notifications.

PackageKit has the model where the source has GObject properties that
change as async ops execute, which isn't bad...but I'd like something
a bit more general where say you can have multiple outstanding async
ops and sensibly track their state.

So, OstreeAsyncProgress is basically a threadsafe property bag with a
change notification signal.

Use this new API to move the GSConsole usage (i.e. g_print()) out from
libostree/ and into ostree/.
14 files changed:
Makefile-libostree-defines.am
Makefile-libostree.am
Makefile-ostree.am
src/libostree/ostree-async-progress.c [new file with mode: 0644]
src/libostree/ostree-async-progress.h [new file with mode: 0644]
src/libostree/ostree-repo-pull.c
src/libostree/ostree-repo.c
src/libostree/ostree-repo.h
src/libostree/ostree.h
src/ostree/ot-admin-builtin-upgrade.c
src/ostree/ot-builtin-pull.c
src/ostree/ot-builtins-common.c [new file with mode: 0644]
src/ostree/ot-builtins-common.h [new file with mode: 0644]
tests/test-sysroot.js